package magicloan.auctionpocket.adapter;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager;

import java.util.ArrayList;

import magicloan.auctionpocket.R;
import magicloan.auctionpocket.ui.base.MyBaseAdapter;

/**
 * Created by hechao on 2018/1/26.
 */
public class MainFgGvLoanAdapter extends MyBaseAdapter{

    protected Context mContext ;
    protected Activity mActivity ;
    protected ArrayList mList ;
    private RequestManager mGlideRequest;

    public MainFgGvLoanAdapter(Activity context){
        super(context);
        mContext = context ;
        mActivity = context ;
        mGlideRequest = Glide.with(context);
    }

    public void setDatas(ArrayList mList){
        this.mList = mList ;
    }

    @Override
    public int getCount() {
        return mList==null?0:mList.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView =  View.inflate(mContext, R.layout.fg_first_re_headv_gride_item,null);
        ImageView img = (ImageView) convertView.findViewById(R.id.img_item_icon);
        int res = 0 ;
        Glide.with(mContext)
                .load("https://icon.cainiaodk.com/1498015948517.png")
                .placeholder(R.mipmap.test)
                .crossFade()
                .into(img);
        return convertView ;
    }

}
